#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdlib.h>

struct Person {
  char *name;
  int age;
};

struct Person *createPerson(char *name, int age)
{
  struct Person *p = malloc(sizeof(p));
  assert (p != NULL);
  p->name = strdup(name);
  p->age = age;
  
  return p;
}

void deletePerson(struct Person* pPerson)
{
  assert(pPerson != NULL);
  
  free(pPerson->name);
  free(pPerson);
}

void printPerson(struct Person *pPerson)
{
  printf("%s: %d\n", pPerson->name, pPerson->age);
}

int main(int argc, char *argv[])
{
  //struct Person p = createPerson("Szoreny", 29);
  struct Person person;
  person.name = "what";
  person.age = 12;
  struct Person *p = &person;
  printPerson(p);
  p->age++;
  printPerson(p);
  deletePerson(p);
  
  return 0;
}